package com.xgxf.server.service.impl;

import com.xgxf.server.common.JsonResult;
import com.xgxf.server.mapper.LoginMapper;
import com.xgxf.server.mapper.ParameterDetailsMapper;
import com.xgxf.server.pojo.LoginDto;
import com.xgxf.server.pojo.LoginResult;
import com.xgxf.server.service.ILoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;

@Service
public class LoginServiceImpl implements ILoginService {

    @Autowired
    private LoginMapper loMapper;
    @Override
    public JsonResult login(LoginDto loginDto) {
        LoginResult result =  loMapper.login(loginDto);
        if (result != null) {
            return JsonResult.success(result,"登陆成功！");
        }
        return JsonResult.error("用户名或密码错误");
    }
}
